﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Equality.Tests
{
    [TestClass]
    public class When_checking_equality_through_referenceEqual
    {
        [TestMethod]
        public void Given_two_different_objects_then_they_should_not_be_equal()
        {
            Animal animal1 = new Animal();
            Animal animal2 = new Animal();

            bool areEqual = object.ReferenceEquals(animal1, animal2);

            Assert.IsFalse(areEqual);
        }


        [TestMethod]
        public void Given_two_different_objects_same_ref_var_then_they_should_not_be_equal()
        {
            Animal animal1 = new Animal();
            Animal animal2 = new Animal();
            Animal animal3 = new Animal();

            animal3 = animal2;

            bool areEqual = object.ReferenceEquals(animal1, animal2);

            Assert.IsFalse(areEqual);

             areEqual = object.ReferenceEquals(animal3, animal2);

            Assert.IsTrue(areEqual);
        }
    }
}